/* ===== 全局样式入口文件 ===== */
@use "./base/variables" as *;
@use "./base/mixins" as *;
@use "./base/reset";
@use "./themes/light";
@use "./themes/dark";
@use "./vendors/element-plus";
@use "./components";
@use "./pages";

/* ===== Element Plus 主题变量映射 ===== */
:root {
  --el-color-primary: var(--color-primary);
  --el-color-primary-light-3: var(--color-primary-light);
  --el-color-primary-light-9: var(--color-primary-lighter);
  --el-text-color-primary: var(--color-text-primary);
  --el-text-color-regular: var(--color-text-secondary);
  --el-text-color-secondary: var(--color-text-tertiary);
  --el-border-color: var(--color-border-primary);
  --el-border-color-light: var(--color-border-secondary);
  --el-bg-color: var(--color-bg-primary);
  --el-bg-color-page: var(--color-bg-tertiary);
  --el-font-family: #{$font-family-base};
  --el-border-radius-base: #{$border-radius-base};
  --el-transition-duration: #{$transition-base};
}

/* ===== 全局元素样式 ===== */
* {
  @include theme-transition;
}

body {
  font-family: $font-family-base;
  color: var(--color-text-primary);
  background: var(--color-bg-tertiary);
  line-height: $line-height-normal;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: $border-radius-sm;

  &:hover {
    background: var(--scrollbar-thumb-hover);
  }
}

/* ===== 选择文本样式 ===== */
::selection {
  background: var(--color-primary-lighter);
  color: var(--color-primary);
}

/* ===== 代码样式 ===== */
code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 4px;
  border-radius: $border-radius-xs;
  font-family: $font-family-code;
  font-size: 0.875em;
}

pre {
  background: var(--code-bg);
  padding: $spacing-md;
  border-radius: $border-radius-base;
  overflow-x: auto;
  font-family: $font-family-code;

  code {
    background: none;
    padding: 0;
  }
}
